/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "UsageMonData.h"

namespace oai::udr::model {

UsageMonData::UsageMonData() {
  m_LimitId = "";
  m_ScopesIsSet = false;
  m_UmLevelIsSet = false;
  m_AllowedUsageIsSet = false;
  m_ResetTimeIsSet = false;
  m_SuppFeat = "";
  m_SuppFeatIsSet = false;
}

UsageMonData::~UsageMonData() {}

void UsageMonData::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const UsageMonData &o) {
  j = nlohmann::json();
  j["limitId"] = o.m_LimitId;
  if (o.scopesIsSet() || !o.m_Scopes.empty())
    j["scopes"] = o.m_Scopes;
  if (o.umLevelIsSet())
    j["umLevel"] = o.m_UmLevel;
  if (o.allowedUsageIsSet())
    j["allowedUsage"] = o.m_AllowedUsage;
  if (o.resetTimeIsSet())
    j["resetTime"] = o.m_ResetTime;
  if (o.suppFeatIsSet())
    j["suppFeat"] = o.m_SuppFeat;
}

void from_json(const nlohmann::json &j, UsageMonData &o) {
  j.at("limitId").get_to(o.m_LimitId);
  if (j.find("scopes") != j.end()) {
    j.at("scopes").get_to(o.m_Scopes);
    o.m_ScopesIsSet = true;
  }
  if (j.find("umLevel") != j.end()) {
    j.at("umLevel").get_to(o.m_UmLevel);
    o.m_UmLevelIsSet = true;
  }
  if (j.find("allowedUsage") != j.end()) {
    j.at("allowedUsage").get_to(o.m_AllowedUsage);
    o.m_AllowedUsageIsSet = true;
  }
  if (j.find("resetTime") != j.end()) {
    j.at("resetTime").get_to(o.m_ResetTime);
    o.m_ResetTimeIsSet = true;
  }
  if (j.find("suppFeat") != j.end()) {
    j.at("suppFeat").get_to(o.m_SuppFeat);
    o.m_SuppFeatIsSet = true;
  }
}

std::string UsageMonData::getLimitId() const { return m_LimitId; }
void UsageMonData::setLimitId(std::string const &value) { m_LimitId = value; }
std::map<std::string, UsageMonDataScope> &UsageMonData::getScopes() {
  return m_Scopes;
}
void UsageMonData::setScopes(
    std::map<std::string, UsageMonDataScope> const &value) {
  m_Scopes = value;
  m_ScopesIsSet = true;
}
bool UsageMonData::scopesIsSet() const { return m_ScopesIsSet; }
void UsageMonData::unsetScopes() { m_ScopesIsSet = false; }
UsageMonLevel UsageMonData::getUmLevel() const { return m_UmLevel; }
void UsageMonData::setUmLevel(UsageMonLevel const &value) {
  m_UmLevel = value;
  m_UmLevelIsSet = true;
}
bool UsageMonData::umLevelIsSet() const { return m_UmLevelIsSet; }
void UsageMonData::unsetUmLevel() { m_UmLevelIsSet = false; }
UsageThreshold UsageMonData::getAllowedUsage() const { return m_AllowedUsage; }
void UsageMonData::setAllowedUsage(UsageThreshold const &value) {
  m_AllowedUsage = value;
  m_AllowedUsageIsSet = true;
}
bool UsageMonData::allowedUsageIsSet() const { return m_AllowedUsageIsSet; }
void UsageMonData::unsetAllowedUsage() { m_AllowedUsageIsSet = false; }
TimePeriod UsageMonData::getResetTime() const { return m_ResetTime; }
void UsageMonData::setResetTime(TimePeriod const &value) {
  m_ResetTime = value;
  m_ResetTimeIsSet = true;
}
bool UsageMonData::resetTimeIsSet() const { return m_ResetTimeIsSet; }
void UsageMonData::unsetResetTime() { m_ResetTimeIsSet = false; }
std::string UsageMonData::getSuppFeat() const { return m_SuppFeat; }
void UsageMonData::setSuppFeat(std::string const &value) {
  m_SuppFeat = value;
  m_SuppFeatIsSet = true;
}
bool UsageMonData::suppFeatIsSet() const { return m_SuppFeatIsSet; }
void UsageMonData::unsetSuppFeat() { m_SuppFeatIsSet = false; }

} // namespace oai::udr::model
